import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
    path: '/home',
    name: 'home',
    component: () => import('@/views/home'),
    children: [
      {
        path: '/home/index',
        name: 'index',
        component: () => import( /* webpackChunkName: "index" */ '@/views/Index')
      },
      {
        path: '/home/mess',
        name: 'mess',
        component: () => import( /* webpackChunkName: "mess" */ '@/views/mess')
      },
      {
        path: '/home/group',
        name: 'group',
        component: () => import( /* webpackChunkName: "group" */ '@/views/group')
      },
      {
        path: '/home/collect',
        name: 'collect',
        component: () => import( /* webpackChunkName: "collect" */ '@/views/collect')
      }
    ]
  },{
    path: '/detail/:id',
    component: () => import('@/views/detail'),
    name: 'detail'
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router